//
//  RegitsterRequest.m
//  TestGizWits
//
//  Created by JM on 15/11/7.
//  Copyright © 2015年 JM. All rights reserved.
//

#import "RegitsterSendSMSRequest.h"
#import <XPGWifiSDK/XPGWifiSDK.h>
#import "DYServer.h"
//NSURLSessionDataTask *dataTask = [manager dataTaskWithRequest:request completionHandler:^(NSURLResponse *response, id responseObject, NSError *error) {
//    if (error) {
//        NSLog(@"Error: %@", error);
//    } else {
//        NSLog(@"%@ %@", response, responseObject);
//    }
//}];
//[dataTask resume];
@interface RegitsterSendSMSRequest()<XPGWifiSDKDelegate>
//@property(nonatomic,copy) FinishLoadBlock block;
@end

@implementation RegitsterSendSMSRequest

- (void)didRealRequest {
    [[XPGWifiSDK sharedInstance] requestSendPhoneSMSCode:self.DY_token captchaId:self.DY_captchaId captchaCode:self.DY_captchaCode phone:self.DY_phone];
}

//使用获取手机短信验证码事件
- (void)wifiSDK:(XPGWifiSDK *)wifiSDK didRequestSendPhoneSMSCode:(NSError *)result
{
    if(result.code == XPGWifiError_NONE) {
        DYResponse* response = [[DYResponse alloc] init];
           self.block(response,nil);
        //获取手机验证码成功
    }
    else
    {
           self.block(nil,result);
        //获取手机验证码失败
    }
    [super superHandelResponse];
}
@end
